package com.Validate.demo;


import com.validate.advocatevalidator.ValidatorsResult;
import com.validate.fluentvalidator.Validator;

import java.util.List;

/**
 * Hello world!
 */
public class App {
	public static void main(String[] args) {

        /*FieldReflection field = new FieldReflection();
        field.reflection(new com.Validate.demo.model());*/

		//Validator.Result(new model());

		long startTime = System.currentTimeMillis();    //获取开始时间
		//for(int i = 0 ;i< 100000;i++){

		model m = new model();
		ValidatorsResult v = new Validator<ValidatorsResult>() {{
			on(m.getD() != null).group("11").group("212");
			on(m.getD2() == 0).group("d2");
		}}.Result(new model());

		//}
		long endTime = System.currentTimeMillis();    //获取结束时间

		System.out.println("程序运行时间：" + (endTime - startTime) + "ms");


		ValidatorsResult v2 = new Validator<ValidatorsResult>().Result(new model());

        /*
        *  Validator.Result(new model()).on(
        *       Viasd(er,er),""
        *  );
        *
        *
        * */

        /*Object WXO =  new com.Validate.demo.model();
        Class cls = WXO.getClass();
        Field[] fields = cls.getDeclaredFields();
        for (Field f : fields) {
            f.setAccessible(true);
            //过滤对象类型
            if(f.getName().indexOf("$") == -1){
                Annotation[] annotations = f.getAnnotations();
                for (Annotation annotation : annotations){
                   // Null nus = (Null) f.getAnnotation(annotation.annotationType());
                }
            }
        }*/

        /*
        Object WXO =  new com.Validate.demo.model();
        Class cls = WXO.getClass();
        Method[] methods = cls.getMethods();
        for (Method m : methods){
            try {
               System.out.println(m.invoke(WXO));
            } catch (IllegalAccessException e) {
                e.printStackTrace();
            } catch (InvocationTargetException e) {
                e.printStackTrace();
            }
        }
        */
	}
}
